package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TGoodsInordersMapper;
import com.ruoyi.system.domain.TGoodsInorders;
import com.ruoyi.system.service.ITGoodsInordersService;

/**
 * 订单商品信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-29
 */
@Service
public class TGoodsInordersServiceImpl implements ITGoodsInordersService 
{
    @Autowired
    private TGoodsInordersMapper tGoodsInordersMapper;

    /**
     * 查询订单商品信息
     * 
     * @param orderId 订单商品信息主键
     * @return 订单商品信息
     */
    @Override
    public TGoodsInorders selectTGoodsInordersByOrderId(String orderId)
    {
        return tGoodsInordersMapper.selectTGoodsInordersByOrderId(orderId);
    }

    @Override
    public TGoodsInorders getSumAmountByGoodsId(String goodsId) {
        return tGoodsInordersMapper.getSumAmountByGoodsId(goodsId);
    }

    /**
     * 查询订单商品信息列表
     * 
     * @param tGoodsInorders 订单商品信息
     * @return 订单商品信息
     */
    @Override
    public List<TGoodsInorders> selectTGoodsInordersList(TGoodsInorders tGoodsInorders)
    {
        return tGoodsInordersMapper.selectTGoodsInordersList(tGoodsInorders);
    }

    /**
     * 新增订单商品信息
     * 
     * @param tGoodsInorders 订单商品信息
     * @return 结果
     */
    @Override
    public int insertTGoodsInorders(TGoodsInorders tGoodsInorders)
    {
        return tGoodsInordersMapper.insertTGoodsInorders(tGoodsInorders);
    }

    /**
     * 修改订单商品信息
     * 
     * @param tGoodsInorders 订单商品信息
     * @return 结果
     */
    @Override
    public int updateTGoodsInorders(TGoodsInorders tGoodsInorders)
    {
        return tGoodsInordersMapper.updateTGoodsInorders(tGoodsInorders);
    }

    /**
     * 批量删除订单商品信息
     * 
     * @param orderIds 需要删除的订单商品信息主键
     * @return 结果
     */
    @Override
    public int deleteTGoodsInordersByOrderIds(String[] orderIds)
    {
        return tGoodsInordersMapper.deleteTGoodsInordersByOrderIds(orderIds);
    }

    /**
     * 删除订单商品信息信息
     * 
     * @param orderId 订单商品信息主键
     * @return 结果
     */
    @Override
    public int deleteTGoodsInordersByOrderId(String orderId)
    {
        return tGoodsInordersMapper.deleteTGoodsInordersByOrderId(orderId);
    }
}
